﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/ViewAdmin.master" AutoEventWireup="true" CodeBehind="News.aspx.cs" Inherits="WebClient.AdminPanel.News" %>

<%@ Import Namespace="InfoSite.Tools" %>

<asp:Content ID="Content2" ContentPlaceHolderID="cphHeader" runat="server">
    <asp:Label runat="server" ID="lPageHeader" />
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="cphContent" runat="server">
    <asp:MultiView runat="server" ID="mvContentEditor">
        <asp:View runat="server" ID="vEditForm">
            <div class="fieldGrid">
                <div class="fieldEntry">
                    <h1>Заголовок [до 150 символов]</h1>
                    <div class="fieldEntryControl">
                        <asp:TextBox runat="server" ID="txtTitle" MaxLength="150" />
                    </div>
                </div>
                <div class="fieldEntry">
                    <h1>Описание [до 200 символов]</h1>
                    <div class="fieldEntryControl">
                        <asp:TextBox runat="server" ID="txtDescription" MaxLength="200" />
                    </div>
                </div>
                <div class="fieldEntry">
                    <h1>Текст</h1>
                    <div class="fieldEntryControl">
                        <ck:CKEditorControl runat="server" ID="ckContent" BasePath="~/ckeditor" Height="300" />
                    </div>
                </div>
                <div class="fieldEntry">
                    <h1>Прикреплённые файлы</h1>
                    <div class="fieldEntryControl">
                        <asp:FileUpload runat="server" ID="fuAttachFile" />
                    </div>
                    <div class="fieldEntryControl">
                        <p>
                            <asp:Button runat="server" ID="btnSaveAttach" Text="Загрузить файл" OnClick="btnSaveAttach_Click" />
                        </p>
                    </div>
                </div>
            </div>
            <div>
                <asp:Repeater runat="server" ID="rptContentAttach" OnItemCommand="rptContentAttach_ItemCommand">
                    <HeaderTemplate>
                        <div class="adminTableContainer">
                            <div class="adminTableBlock">
                                <div class="adminTableRow adminTableRowHeader">
                                    <div class="adminTableRow32">
                                        <asp:Label ID="lFileIconHdr" runat="server" Text='<%$ Resources:SiteResources, resWhitespace %>' />
                                    </div>
                                    <div class="adminTableRow300">
                                        <asp:Label ID="lFileNameHdr" runat="server" Text='<%$ Resources:SiteResources, resFileName %>' />
                                    </div>
                                    <div class="adminTableRow150 centered">
                                        <asp:Label ID="lFileFormatHdr" runat="server" Text='<%$ Resources:SiteResources, resFileFormat %>' />
                                    </div>
                                    <div class="adminTableRow150 centered">
                                        <asp:Label ID="lFileSizeHdr" runat="server" Text='<%$ Resources:SiteResources, resFileSize %>' />
                                    </div>
                                </div>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <div class="adminTableRow">
                            <div class="adminTableRow32">
                                <asp:LinkButton runat="server" ID="btnOpenDocumentIcon" CssClass='<%# PageHelper.GetAttachIconClass(Eval("DocumentName")) %>'
                                    Text='<%$ Resources:SiteResources, resWhitespace %>' />
                            </div>
                            <div class="adminTableRow300">
                                <asp:LinkButton runat="server" ID="btnOpenDocument" Text='<%# Eval("DocumentName") %>'
                                    CommandName="OpenAttach" CommandArgument='<%# Eval("AttachId") %>' />
                            </div>
                            <div class="adminTableRow150 centered">
                                <asp:Label ID="lDocumentType" runat="server" Text='<%# Eval("DocumentType") %>' />
                            </div>
                            <div class="adminTableRow150 centered">
                                <asp:Label ID="lFileSize" runat="server" Text='<%# PageHelper.GetRoundedFileSize(Eval("DocumentSize")) %>' />
                            </div>
                            <div class="adminTableRowIconBlock">
                                <div class="adminTableRowIcon">
                                    <asp:LinkButton ID="btnDeleteAttach" runat="server" ToolTip='<%$ Resources:SiteResources, resDelete %>'
                                        CommandName="DeleteAttach" CommandArgument='<%# Eval("AttachId") %>' OnClientClick="return confirm('Подтвердите удаление')"
                                        CssClass="adminTableRowDelete" />
                                </div>
                            </div>
                        </div>
                    </ItemTemplate>
                    <FooterTemplate>
                        </div> </div>
							<div style="clear: both;">
                            </div>
                    </FooterTemplate>
                </asp:Repeater>
            </div>
            <div style="overflow: hidden; text-align: right; padding: 20px 15px 0 0">
                <asp:Button runat="server" ID="btnSave" Text="Сохранить" OnClick="BtnSaveClick" />
            </div>
        </asp:View>
        <asp:View runat="server" ID="vListEditForm">
            <div style="overflow: hidden; display: block; margin-bottom: 16px;">
                <asp:Button runat="server" ID="btnAddListItem" OnClick="btnAddListItem_Click" Text="Добавить" />
            </div>
            <asp:Repeater runat="server" ID="rptList" OnItemCommand="rptList_ItemCommand">
                <HeaderTemplate>
                    <asp:Literal runat="server" ID="lOpenDiv" Text="<div>" />
                </HeaderTemplate>
                <ItemTemplate>
                    <div style="overflow: hidden; width: 100%;">
                        <div style="float: left; width: 140px;">
                            <%# Eval("CreateDate") %>
                        </div>
                        <div style="float: left; width: 400px; padding: 0 20px 20px 0;">
                            <asp:LinkButton runat="server" ID="lCompanyMessageTeaser" Text='<%# Eval("Title") %>' CommandName="EditListItem" CommandArgument='<%# Eval("SiteContentId") %>' />
                        </div>
                        <div class="adminButton">
                            <asp:LinkButton runat="server" ID="btnDeleteListItem" CommandName="DeleteListItem" CommandArgument='<%# Eval("SiteContentId") %>' ToolTip="Удалить" CssClass="buttonDelete" OnClientClick="return confirm('Подтвердите удаление')" />
                        </div>
                        <div class="adminButton">
                            <asp:LinkButton runat="server" ID="btnEditListItem" CommandName="EditListItem" CommandArgument='<%# Eval("SiteContentId") %>' ToolTip="Правка" CssClass="buttonEdit" />
                        </div>
                    </div>
                </ItemTemplate>
                <FooterTemplate>
                    <asp:Literal runat="server" ID="lCloseDiv" Text="</div>" />
                </FooterTemplate>
            </asp:Repeater>
        </asp:View>
    </asp:MultiView>
</asp:Content>
